<template>
  <div>
    <el-col :span="8">
      <el-form-item :label="title">
        <el-input
          v-model="inputValue"
          :placeholder="`${placeholder}${title}`"
        ></el-input>
      </el-form-item>
    </el-col>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: "",
    },
    value: {
      type: String,
      default: "",
    },
    placeholder: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      inputValue: this.value,
    };
  },
  watch: {
    value(newVal) {
      this.inputValue = newVal;
    },
    inputValue(newVal) {
      this.$emit("input", newVal);
    },
  },
};
</script>

<style lang="scss" scoped>
.el-form-item {
  width: 371px;
  .el-input {
    width: 70%;
  }
  ::v-deep .el-form-item__label {
    width: 96px;
  }
}
</style>
